Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [MDS] Support for Timeline #6493

Merged
merged 3 commits into from
May 13, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 73e5d78 from #6385.

* Add MDS support to Timeline

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor to function and add unit tests

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Fix typo in args

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor build request to pass unit tests

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add to CHANGELOG

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor error messages + address comments

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Fix ut

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Change to data source feature

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Fix UT

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Address comments

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
(cherry picked from commit 73e5d78)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
@ZilongX
Copy link
Collaborator

ZilongX commented Apr 17, 2024

is this one targeting 2.14. or 2.15 ? seen the 2.15 tag but if we merged into 2.x now it would be released out as part of 2.14

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.85%. Comparing base (9cbfa64) to head (087dd16).
Report is 41 commits behind head on 2.x.

❗ Current head 087dd16 differs from pull request most recent head ef9c3c0. Consider uploading reports for the commit ef9c3c0 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              2.x    #6493      +/-   ##
==========================================
+ Coverage   31.75%   31.85%   +0.10%     
==========================================
  Files        2220     2223       +3     
  Lines       44686    44743      +57     
  Branches     6951     6960       +9     
==========================================
+ Hits        14190    14253      +63     
+ Misses      29839    29830       -9     
- Partials      657      660       +3     
Flag Coverage Δ
Linux_1 31.85% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhongnansu
Copy link
Member

is this one targeting 2.14. or 2.15 ? seen the 2.15 tag but if we merged into 2.x now it would be released out as part of 2.14

@huyaboo I think it's for 2.14, can you confirm?

throw new Error('To query from multiple data sources, first enable the data source feature');
}

const dataSources = await client.find<DataSourceAttributes>({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should need to query the cluster every time to get the source. If I put an auto refresh interval then it seems like this will hit the cluster twice per request. I think we should caching these data sources like index patterns. If the data source exists in that cache then we can just pull that, if not then the service will pull the data sources.

return undefined;
}

if (!getDataSourceEnabled().enabled) {
Copy link
Member

@kavilla kavilla Apr 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can imagine a world where saved objects were imported from a cluster that enabled MDS to a new domain that didn't enable it. If the timeline vis was added to a dashboard now it will fail.

Do we want to consider that if it's not enabled it just queries to the local cluster?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing behavior with Timeline is that any invalid params are caught and a toast error is displayed, meaning before this merge, if a user types in data_source_name, a toast would be thrown anyway because this was not a named argument. This means that any syntax error or invalid param can and should be caught. If the visualization just queries a local cluster, then it can be confusing behavior especially since this change enables Timeline to query both local cluster and MDS queries within one visualization.

@huyaboo huyaboo added the multiple datasource multiple datasource project label Apr 24, 2024
@zhongnansu zhongnansu merged commit 64af4b5 into 2.x May 13, 2024
65 of 66 checks passed
@github-actions github-actions bot deleted the backport/backport-6385-to-2.x branch May 13, 2024 17:44
@zhyuanqi zhyuanqi added bug Something isn't working enhancement New feature or request and removed bug Something isn't working enhancement New feature or request labels Jun 11, 2024
@zhongnansu zhongnansu added the enhancement New feature or request label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocut Skip the changelog verification check on backports enhancement New feature or request multiple datasource multiple datasource project repeat-contributor v2.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants